Skip to content

Increase branch coverage: Array.prototype functions #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

matedabis
Copy link
Contributor

Added new test cases to improve branch coverage in Array.prototype routines.

The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file.

https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py

While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in this PR.

Branch coverage:
-before: 399 / 476
-after: 472 / 476

There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them.
The other 14 functions are either already covered, or we could not improve the coverage of it.

More information about the coverage improvement and the branches not reached:
https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e

While improving the coverage we found unnecessary condition checks, which can not be false in any cases.

Co-authored-by: Csaba Repasi [email protected]
JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]

Copy link
Member

@rerobika rerobika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me in overall, after fixing the style issues.

@matedabis matedabis force-pushed the coverage_improvement_a branch from 9f7adfb to 001e86b Compare March 13, 2019 11:15
@matedabis
Copy link
Contributor Author

I updated the patch according to your review, however I could not apply this request, because it worked differently for me and I could not find any information about how it handles empty object as 3rd argument.

An empty object is enough for the 3rd argument, it will set the writable attribute to false by default. (Same as above).

@matedabis matedabis force-pushed the coverage_improvement_a branch from 001e86b to 51748dd Compare March 14, 2019 08:28
@matedabis
Copy link
Contributor Author

Updated the patch and found a similar way to apply that request.

@matedabis matedabis force-pushed the coverage_improvement_a branch from 51748dd to 6300a92 Compare March 18, 2019 12:31
@matedabis
Copy link
Contributor Author

Fixed the mentioned issues.

Added new test cases to improve branch coverage in Array.prototype routines.

The following script is made for testing branch coverage with all the test suites (--jerry-test-suite --test262 --unittests --jerry-tests), or with only one .js file.

https://github.com/matedabis/jerryscript/blob/gcov_coverage_tester/tests/gcov-tests/gcovtester.py

While measuring the branch coverage we dont count JERRY_ASSERT s. The results are measured by running all the test scripts, with the modifications in the PRs.

Branch coverage including pando-project#2682 and pando-project#2674:
	-before: 399 / 476
	-after:  472 / 476

There are 28 functions in ecma-builtin-array-prototype.c, we hit 14 from them.
The other 14 functions are either already covered, or we could not improve the coverage of it.

More information about the coverage improvement and the branches not reached:
https://gist.github.com/matedabis/d7b9fc0690aa2f4be6aa160fdf482e0e

While improving the coverage we found an unnecessary condition check, which can not be false in any cases.

Co-authored-by: Csaba Repasi [email protected]
JerryScript-DCO-1.0-Signed-off-by: Csaba Repasi [email protected]
JerryScript-DCO-1.0-Signed-off-by: Mate Dabis [email protected]
@matedabis matedabis force-pushed the coverage_improvement_a branch from 6300a92 to 56651f9 Compare March 18, 2019 13:07
Copy link
Member

@rerobika rerobika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (informal)

Copy link
Member

@dbatyai dbatyai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbatyai dbatyai merged commit 09d8793 into jerryscript-project:master Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants